<template>
  <div v-loading="loading">
    <div class="popup_box">
      <!-- 基本信息 -->
      <div class="base">
        <div class="logo">
          <img :src="details.user_info.avatar" alt="">
        </div>
        <div class="info">
          <div class="title">
            <div class="name">
              {{ details.user_info.username || '未知' }}
            </div>

            <div class="user">
              <span>(</span>
              <span>会员ID:{{ details.member_id }}；考生ID:{{ details.id }}；；考试ID:{{ details.exam_id }}</span>
              <span class="logoin"> {{details.exam_name}}</span>
              <span>；</span>

              <span>)</span>
            </div>
          </div>
          <div class="details">
            <el-row class="line">
              <el-col :span="12">
                <label class="line_label">基础资料：</label>
                <span class="text">
                  {{ details.user_info.cardid || '身份证号' }} | {{ details.user_info.sex || '性别' }} | {{ details.user_info.age || '年龄' }}
                </span>
              </el-col>

            </el-row>
            <el-row class="line">
              <el-col :span="12">
                <label class="line_label">审核状态：</label>
                <span class="text">

                  <span style='color:#409EFF'> {{details.review_status_txt  || '未提交'}}</span>
                </span>
              </el-col>

            </el-row>
            <el-row class="line">
              <el-col :span="12">
                <label class="line_label">支付状态：</label>
                <span class="text">
                  <span style='color:#409EFF'> {{details.pay_status_txt  || '未支付'}}</span>
                </span>
              </el-col>

            </el-row>


          </div>
        </div>
      </div>
      <!-- 切换 -->
      <div class="tab_box">
        <el-tabs v-model="activeName" @tab-click="handleClick">

          <el-tab-pane label="基础信息" name="memberInformation">
            <memberInformation :id="details.id" ref="memberInformation" :uid="details.uid" />
          </el-tab-pane>
          <el-tab-pane label="审核记录" name="first">
            <followUpRecord :id="details.id" ref="first" :rows="details" @click-event='updateDetails'/>
          </el-tab-pane>

        </el-tabs>
      </div>

    </div>
  </div>
</template>

<script>
import followUpRecord from '@/views/kaowu/kaowu/examuser/components/FollowUpRecord'


import memberInformation from '@/views/kaowu/kaowu/examuser/components/MemberInformation'
import { parseTime, setMemberLogin } from '@/utils'
import { doReview ,reviewList,examUserInfo} from '@/api/kaowu/exam'

export default {
  name: 'UrmShow',
  filters: {
    timeFilter(timestamp) {
      return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}')
    }
  },
  components: {
    followUpRecord,
    memberInformation
  },
  props: {
    rows: {
      default: ''
    }
  },
  data(){
    return {
      details: null,
      activeName: 'first',
      loading: true
    }
  },
  created () {
    this.activeName = this.rows.tabName
    this.userInfoDetails()
  },
  methods: {
    updateDetails(payload){
      this.userInfoDetails()
    },
    userInfoDetails(){
      examUserInfo({ 'id': this.rows.id})
        .then(res => {
          this.details = res.data.info
          this.loading = false
        }).catch(() => {

        })
    },
    handleClick(e){
      this.$refs[this.activeName].init()
    }
  }
}
</script>

<style lang="scss" scoped>
.complete_percent{
  ::v-deep .el-progress__text{
    color:unset;
  }
}
.bind{
  padding-bottom: 20px;
  text-align: center;
  img{
    width: 256px;
    height: 256px;
  }
  .title{
    margin-top: 20px;
    font-size: 14px;
    color: rgb(156, 156, 156);
  }
}
.bind_icon{
  display: inline-block;
  float: left;
  margin-right: 5px;

}
::v-deep .el-tabs__nav-wrap{
  margin-bottom: 0px;
}
::v-deep .el-tabs__header{
  margin: 0px;
}
::v-deep .el-tabs__nav-scroll{
  line-height: 50px;
  padding-left: 30px;
}
::v-deep .el-tabs__nav-wrap{
  background: #fcfcfc;
  border-top: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
}
::v-deep .el-tabs__nav-wrap::after {
  background-color:transparent
}
//弹窗
.popup_box {
  height: 100%;
  // 基本信息
  .base {
    padding: 20px 30px;
    display: flex;
    .logo {
      width: 118px;
      height: 118px;
      margin-right: 20px;
      background-color: #ebeef5;
      border: 1px solid #ebeef5;
      border-radius: 50%;
      img {
        border-radius: 8px;
        width: 100%;
        height: 100%;
      }
    }
    .info {
      flex: 1;
      .title {
        padding: 5px 0 18px;
        display: flex;
        .name {
          font-size: 20px;
          height: 20px;
          color: #303033;
          font-weight: 600;
          margin-right: 10px;
        }
        .user {
          padding-top: 6px;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
          color: #777;
          .logoin {
            color: #0078ff;
            cursor: pointer;
          }
        }
      }
      .details {
        max-width: 100%;
        .line {
          margin-bottom: 8px;
          .line_label {
            color: #777;
            font-size: 14px;
            line-height: 14px;
            font-weight: normal;
          }
          .text {
            display: inline-block;
            font-size: 14px;
            line-height: 14px;
          }
          .text_color{
            color: #0078ff;
            cursor:pointer ;
          }
        }
      }
    }
    .details{
      .invite_text{
        color: #1787fb;
      }
    }
  }
  .tab_box{
    position: relative;
  }
  .qcc_box{
    width: 63px;
    height: 20px;
    position: absolute;
    right: 30px;
    z-index:30;
    cursor: pointer;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .job_sum{
    color: #f56c6c;
  }
  .close {
    width: 40px;
    height: 60px;
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    .el-icon-close {
      font-size: 30px;
      color: #777;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }
}
// 邀请弹窗
::v-deep .el-dialog__body{
  padding: 1px 0;
}
.code_wrapper{
  text-align: center;
  .code_img{
    width: 256px;
    height: 256px;
  }
  .code_text{
    font-size: 12px;
    color: #979797;
  }
  .tip{
    font-size: 14px;
    font-weight: 300;
    color: #f56c6c;
    background-color: #fef0f0;
    margin: 20px auto;
    padding: 10px 20px;
    text-align: center;
  }
}
</style>
